package action

import (
	"comm/api/commport/service"
	"comm/dto"
	"comm/selfreg"
	"core/action"
	"core/corestruct"
	"reflect"
)

type InsertAction struct {
}

func (p *InsertAction) Do(mm *dto.CommPortDto, ctx *corestruct.HttpContext) (int64, error) {
	return service.MainService.Insert(mm, ctx)
}

func init() {

	var mact = &InsertAction{}
	var maction = action.Action{
		Method: "get",

		FullUrl: URLPrev + "/Insert",
		Name:    "添加" + PAGEName,
		Ename:   "",
		Memo:    "",

		PinType:    "",
		PinIslist:  false,
		PoutType:   "",
		PoutIslist: false,
		PoutIspage: false,

		AuthType: action.AuthType_AUTH,

		LogNeed:     true,
		LogPin:      true,
		LogPout:     true,
		LogTemplete: "",

		PrjName: "",

		Value: reflect.ValueOf(mact),
	}
	selfreg.AddAction(&maction)
}
